package dao

import (
	"main/model"
	"main/tool"
)

type GoodDao struct {
	*tool.OrmEngine
}

func NewGoodDao() *GoodDao {
	return &GoodDao{tool.DbEngine}
}


func (gd *GoodDao) QueryGoods(shop_id int64) ([]model.Goods, error) {
	var goods []model.Goods
	err := gd.OrmEngine.Where("shop_id = ?", shop_id).Find(&goods)
	if err != nil {
		return nil, err
	}
	return goods, nil
}



